﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Menu1_ItemSelected(object sender, ComponentArt.Web.UI.MenuItemEventArgs e)
    {
        if (e.Item.ParentItem.Text == "Add")
        {
            ComponentArt.Web.UI.MenuItem newItem = new ComponentArt.Web.UI.MenuItem();
            newItem.Text = "New " + e.Item.Text;
            e.Item.ParentItem.Items.Add(newItem);
        }

        else if (e.Item.ParentItem.Text == "Disable")
        {
            e.Item.Enabled = false;
        }

        else if (e.Item.ParentItem.Text == "Remove")
        {
            e.Item.ParentItem.Items.Remove(e.Item);
        }
    }
}